package ch04.ex01;

import java.text.DateFormatSymbols;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class CalendarTest {
	
	public static void main(String[] args) {
// 1
		GregorianCalendar d = new GregorianCalendar();
		
// 2
		// set d to the start of the month
		d.set(Calendar.DAY_OF_MONTH, 1);

// 3
		// print weekdayNames
		String[] weekdayNames = new DateFormatSymbols().getShortWeekdays();
		for (int i = 1; i < weekdayNames.length; i++) {
			System.out.printf("%4s", weekdayNames[i]);
		}
		//这个数组居然有8个成员
//		for (String weekdayName : weekdayNames) {
//			System.out.printf("%4s", weekdayName);
//		}
		System.out.println("");
		
	}
	
}
